Fputchar

Section: Oct. 1, 1991 (2)
Updated: MiNT Programmer's Manual
Index Return to Main Contents
 

NAME

Fputchar - read a character from a file  

SYNOPSIS

LONG Fputchar( WORD fh, LONG ch, WORD mode );
 

DESCRIPTION

Fputchar outputs a character to the GEMDOS file whose handle is fh. The parameter mode has an effect only if the open file is a terminal or pseudo-terminal, in which case the bits of mode have the following meanings:
0x0001
Cooked mode; special control characters (control-C and control-Z) are checked for and interpreted if found (they cause SIGINT and SIGTSTP, respectively, to be raised); also, flow control with control-S and control-Q is activated.

If the file receiving output is a pseudo-terminal, then all 4 bytes of ch are recorded in the write, and may be retreived by a Fputchar call on the other side of the pseudo-terminal; this allows programs to pass simulated BIOS scan codes and shift key status through the pseudo-terminal.

If the file receiving output is not a terminal, then only the low order byte of ch is written to the file.  

RETURNS

4 (the number of bytes of data transferred) if the write was to a terminal

1 if the write was not to a terminal and was successful

0 if the bytes could not be output (for example, because of flow control)

EIHNDL if fh is not a valid handle for an open file.

A (long) negative BIOS error code if an error occured during physical I/O.  

SEE ALSO

Bconout(2), Cauxout(2), Cconout(2), Crawio(2), Fgetchar(2), Fwrite(2)


 

Index

NAME
SYNOPSIS
DESCRIPTION
RETURNS
SEE ALSO

This document was created by man2html, using the manual pages.
Time: 16:01:23 GMT, March 03, 2023